package com.zlm.user.emp.controller;

import com.zlm.common.base.BaseController;
import com.zlm.common.constants.CodeConstants;
import com.zlm.common.dto.JsonResultDto;
import com.zlm.common.entity.MenuTree;
import com.zlm.user.emp.service.BasPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: duyufu
 * @Date: 2019/5/16 9:29
 */
@RestController
@RequestMapping(value = "/basPost")
public class BasPostController extends BaseController {

    @Autowired
    private BasPostService basPostService;
    /**
     * 获取所有职位列表
     * @param category
     * @return
     */
    @GetMapping("/getAllPostMenu")
    public JsonResultDto getAllPostMenu(Integer category) {
        try {
            List<MenuTree> postMenu = basPostService.getAllPostMenu(category);
            return success(postMenu);
        } catch (Exception e) {
            e.printStackTrace();
            return fail(CodeConstants.CODE_BUSY);
        }

    }
}
